---
/**
 * Local filepath of the file to download.
 * If there's a static file you should store it in `/public/<filename>`,
 * and then pass the filepath as `/<filename>`.
 */
interface Props {
  filepath: string
  filename?: string
  class?: string
}

let { filepath, filename, class: suppliedClass } = Astro.props

filename = filename || filepath.split("/").pop()
---

<a
  href={filepath}
  download={filename}
  class:list={[suppliedClass]}
>
  {filename}
</a>
